//package com.daocao.hua.activity;
//
//import android.os.Bundle;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.daocao.hua.R;
//import com.daocao.hua.constant.Const;
//import com.daocao.hua.event.OnHomeEventMsg;
//import com.daocao.hua.event.OnRepayFailEventMsg;
//import com.daocao.hua.event.OnRepaySuccessEventMsg;
//import com.daocao.hua.util.Util;
//
//import org.greenrobot.eventbus.EventBus;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * 提交结果页
// */
//public class RepayResultActivityNew extends BaseActivity
//        implements OnClickListener {
//
//    private TextView finish_btn;
//    private TextView again_btn;
//    private ImageView btn_close;
//    private RelativeLayout rl_tip;
//    private LinearLayout successLayout;
//    private LinearLayout failedLayout;
//    private TextView money;
//    private TextView overdue;
//    private TextView time;
//    private TextView textView3;
//    private int type;
//    private String repayMoney, repayOverdue;
//    private int isRecharge;
//    private TextView txtSuccess;
//    private TextView txtFail;
//
//    protected void onCreate(Bundle paramBundle) {
//        super.onCreate(paramBundle);
//        setBaseContentView(R.layout.repay_result_activity_new);
//        baseInitView(this, "RepayResultActivityNew", Const.ViewType.ACTIVITY);
//        initView();
//    }
//
//    private void initView() {
//        try {
//            type = getIntent().getIntExtra("type", 0);
//            repayMoney = getIntent().getStringExtra("money");
//            isRecharge = getIntent().getIntExtra("recharge", 0);
//            repayOverdue = getIntent().getStringExtra("overdue");
//            if (repayMoney.contains("￥")) repayMoney = repayMoney.replace("￥", "");
//            if (repayOverdue.contains("￥")) repayOverdue = repayOverdue.replace("￥", "");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//        getLeftImgBtn().setVisibility(View.GONE);
//        setBackIntent();
//        finish_btn = ((TextView) findViewById(R.id.finish_btn));
//        finish_btn.setOnClickListener(this);
//        btn_close = ((ImageView) findViewById(R.id.btn_close));
//        btn_close.setOnClickListener(this);
//        rl_tip = (RelativeLayout) findViewById(R.id.rl_tip);
//        successLayout = (LinearLayout) findViewById(R.id.submit_success_view);
//        txtSuccess = (TextView) findViewById(R.id.txt_success);
//        txtFail = (TextView) findViewById(R.id.txt_fail);
//        failedLayout = (LinearLayout) findViewById(R.id.submit_failed_view);
//        money = ((TextView) findViewById(R.id.repay_money));
//        overdue = ((TextView) findViewById(R.id.overdue));
//        time = ((TextView) findViewById(R.id.time));
//        textView3 = (TextView) findViewById(R.id.textView3);
//        again_btn = (TextView) findViewById(R.id.submit_btn_again);
//        again_btn.setOnClickListener(this);
//        if (type == 3) {
//            if (isRecharge == 1) {
//                setTitleText("支付成功");
//                txtSuccess.setText("支付成功");
//            } else {
//                setTitleText("提交成功");
//            }
//            successLayout.setVisibility(View.VISIBLE);
//            failedLayout.setVisibility(View.GONE);
//            finish_btn.setVisibility(View.VISIBLE);
//            again_btn.setVisibility(View.GONE);
//            textView3.setVisibility(View.VISIBLE);
//        } else if (type == 4) {
//            if (isRecharge == 1) {
//                setTitleText("支付失败");
//                txtFail.setText("支付失败");
//                again_btn.setText("重新支付");
//            } else {
//                setTitleText("提交失败");
//            }
//            successLayout.setVisibility(View.GONE);
//            failedLayout.setVisibility(View.VISIBLE);
//            finish_btn.setVisibility(View.GONE);
//
//            again_btn.setVisibility(View.VISIBLE);
//            textView3.setVisibility(View.GONE);
//        }
//        money.setText("￥" + repayMoney);
//        overdue.setText("￥" + repayOverdue);
//        time.setText(Util.timeStamp2Date(System.currentTimeMillis() / 1000 + "", ""));
//    }
//
//
//    public void onClick(View paramView) {
//        switch (paramView.getId()) {
//            default:
//                return;
//            case R.id.finish_btn:
//                sendEventBus(Const.View.REPAY_VIEW);
//                break;
//            case R.id.btn_close:
//                rl_tip.setVisibility(View.GONE);
//                break;
//            case R.id.submit_btn_again:
//                sendEventBus(Const.View.REPAY_VIEW);
//                break;
//        }
//    }
//
//
//    /**
//     * 切换主界面
//     *
//     * @param currentIndex
//     */
//    private void sendEventBus(int currentIndex) {
//
//        Map<String, String> map = new HashMap<>();
//        map.put("type", Const.SendType.SWITCH_PAGE);
//        map.put("currentIndex", currentIndex + "");
//        EventBus.getDefault().post(new OnHomeEventMsg(map));
//        finish();
//    }
//
//
//    @Override
//    public void finish() {
//        if (isRecharge == 1) {
//            EventBus.getDefault().post(new OnRepayFailEventMsg());
//        } else {
//            EventBus.getDefault().post(new OnRepaySuccessEventMsg());
//        }
//        super.finish();
//    }
//}
